from django.db import models

class Supplier(models.Model):
    STATUS_CHOICES = (
        (0, '禁用'),
        (1, '启用'),
    )

    name = models.CharField('供应商名称', max_length=100)
    contact = models.CharField('联系人', max_length=50)
    phone = models.CharField('联系电话', max_length=11)
    address = models.CharField('地址', max_length=200)
    status = models.IntegerField('状态', choices=STATUS_CHOICES, default=1)
    create_time = models.DateTimeField('创建时间', auto_now_add=True)
    update_time = models.DateTimeField('更新时间', auto_now=True)

    class Meta:
        verbose_name = '供应商'
        verbose_name_plural = verbose_name
        ordering = ['-create_time']

    def __str__(self):
        return self.name 